package com.software.cool.api.admin.v1.controller;

import com.software.cool.common.CommonContant;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * HTML
 */
@Controller
@RequestMapping("")
public class HtmlSystemController extends BaseController {

    @RequestMapping("/")
    public String home(HttpServletRequest request){
        if(isAdminLogin(request))
        {
            return "index";
        }else{
            return isAdminIndex(request,"page/login",true);
        }
    }

    @RequestMapping("/login")
    public String login(HttpServletRequest request){
        if(isAdminLogin(request))
        {
            return "index";
        }else{
            return isAdminIndex(request,"page/login",true);
        }

    }
    @RequestMapping("/logout")
    public String logout(HttpServletRequest request){
        HttpSession session = request.getSession();
        session.removeAttribute(CommonContant.ADMIN_LOGIN_SESSION);
        return isAdminIndex(request,"page/login",true);
    }

    @RequestMapping("/index")
    public String index(HttpServletRequest request){
        return isAdminIndex(request,"index",true);
    }

    @RequestMapping("/page/welcome")
    public String welcome(HttpServletRequest request){
        return isAdminIndex(request,"page/welcome",true);
    }

    @RequestMapping("/page/error/404")
    public String p404(HttpServletRequest request){
        return isAdminIndex(request,"page/error/404",true);
    }


    @RequestMapping("/page/system/home")
    public String systemHome(HttpServletRequest request){
        return isAdminIndex(request,"page/system/home",true);
    }

    @RequestMapping("/page/system/icon")
    public String icon(HttpServletRequest request){
        return isAdminIndex(request,"page/system/icon",true);
    }

    @RequestMapping("/page/system/user-password")
    public String userPassword(HttpServletRequest request){
        return isAdminIndex(request,"page/system/user-password",true);
    }

    @RequestMapping("/page/system/user")
    public String user(HttpServletRequest request){
        return isAdminIndex(request,"page/system/user",true);
    }

    @RequestMapping("/page/system/user/edit")
    public String userEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/user/edit",true);
    }

    @RequestMapping("/page/system/user/import")
    public String userImport(HttpServletRequest request){
        return isAdminIndex(request,"page/system/user/import",true);
    }

    @RequestMapping("/page/system/app")
    public String app(HttpServletRequest request){
        return isAdminIndex(request,"page/system/app",true);
    }

    @RequestMapping("/page/system/app/edit")
    public String appEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/app/edit",true);
    }

    @RequestMapping("/page/system/app/share")
    public String appShare(HttpServletRequest request){
        return isAdminIndex(request,"page/system/app/share",true);
    }

    @RequestMapping("/page/system/role")
    public String role(HttpServletRequest request){
        return isAdminIndex(request,"page/system/role",true);
    }

    @RequestMapping("/page/system/role/edit")
    public String roleEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/role/edit",true);
    }

    @RequestMapping("/page/system/role-menu/edit")
    public String roleMenuEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/role-menu/edit",true);
    }

    @RequestMapping("/page/system/menu")
    public String menu(HttpServletRequest request){
        return isAdminIndex(request,"page/system/menu",true);
    }

    @RequestMapping("/page/system/menu/edit")
    public String menuEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/menu/edit",true);
    }

    @RequestMapping("/page/system/org")
    public String org(HttpServletRequest request){
        return isAdminIndex(request,"page/system/org",true);
    }

    @RequestMapping("/page/system/org/edit")
    public String orgEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/org/edit",true);
    }

    @RequestMapping("/page/system/area")
    public String area(HttpServletRequest request){
        return isAdminIndex(request,"page/system/area",true);
    }

    @RequestMapping("/page/system/area/edit")
    public String areaEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/area/edit",true);
    }

    @RequestMapping("/page/system/sport")
    public String sport(HttpServletRequest request){
        return isAdminIndex(request,"page/system/sport",true);
    }

    @RequestMapping("/page/system/sport/edit")
    public String sportEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/sport/edit",true);
    }

    @RequestMapping("/page/system/sport/import")
    public String sportImport(HttpServletRequest request){
        return isAdminIndex(request,"page/system/sport/import",true);
    }

    @RequestMapping("/page/system/fitness-test-standard-weight")
    public String fitnessTestStandardWeight(HttpServletRequest request){
        return isAdminIndex(request,"page/system/fitness-test-standard-weight",true);
    }

    @RequestMapping("/page/system/fitness-test-standard-weight/edit")
    public String fitnessTestStandardWeightEdit(HttpServletRequest request){
        return isAdminIndex(request,"page/system/fitness-test-standard-weight/edit",true);
    }

    @RequestMapping("/page/system/fitness-test-standard-weight/import")
    public String fitnessTestStandardWeightImport(HttpServletRequest request){
        return isAdminIndex(request,"page/system/fitness-test-standard-weight/import",true);
    }

}